﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using favweb.Models;
using MyCore.Entities;
using MyCore.Repositories;
using MyCore.Api.Controllers;

namespace favweb.Controllers
{
    public class HomeController : BaseController2
    {
        private readonly ILogger<HomeController> _logger;
        public HomeController(IUnitOfWork uow) : base(uow) { }

      

        public IActionResult Index()
        {

            var list = _uow.Repository<Fav>().GetAll().Take(2).ToList();
            ViewBag.Fav = list;
            return View(list);
        }

        public IActionResult Privacy()
        {
            return View();
        }

        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }
    }
}
